package io.renren.modules.app.controller.info;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.app.entity.info.SalaryEntity;
import io.renren.modules.app.service.info.SalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;


/**
 * 
 *
 * @date 2023-12-12 12:48:12
 */
@RestController
@RequestMapping("salary")
public class SalaryController {
    @Autowired
    private SalaryService SalaryService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = SalaryService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
		SalaryEntity Salary = SalaryService.getById(id);

        return R.ok().put("Salary", Salary);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody SalaryEntity Salary){
		SalaryService.save(Salary);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody SalaryEntity Salary){
		SalaryService.updateById(Salary);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
		SalaryService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
